const express = require('express')
const app = express()
const path = require('path')
const { createProxyMiddleware } = require('http-proxy-middleware')

app.use(
	'/boss',
	createProxyMiddleware({
		target: 'http://eduboss.lagou.com',
		changeOrigin: true
	})
)

app.use(
	'/front',
	createProxyMiddleware({
		target: 'http://edufront.lagou.com',
		changeOrigin: true
	})
)

// 托管 dist 目录
app.use(express.static(path.join(__dirname, '../dist')))

// app.get('/', (req, res) => {
// 	res.send('hello');
// });

app.listen(3000, () => {
	console.log('running ...')
})
